const noticeStore={
  namespaced: true,
  state() {
    return {
      websocket:null,
      noticeList:[],//消息列表
    }
  },
  mutations: {
    setWs(state:any,data:any){
      state.websocket=data
    },
    setNoticeList(state:any,data:{type:string,msg:object,index:number}){
      if(data.type=='add'){
        state.noticeList.push(data.msg)
      }else if(data.type=='clear'){
        state.noticeList=[]
      }else if(data.type=='remove'){
        state.noticeList.splice(data.index,1)
      }
    }
  }
}
export default noticeStore